﻿using Login.Web.Models;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Principal;
using System.Web;

namespace Login.Web.Infrastructure
{
    interface ICustomPrincipal : IPrincipal
    {
        UserModel User { get; set; }
    }

    public class CustomPriceipal : ICustomPrincipal
    {
        public IIdentity Identity { get; private set; }

        public bool IsInRole(string role)
        {
            return false;
        }

        public CustomPriceipal(string email)
        {
            this.Identity = new GenericIdentity(email);
        }
        public bool IsAdmin { get; set; } = false;
        public string UserName { get; set; }
        public UserModel User { get; set; }

    }

    public class CustomPrincipalSerializeModel
    {
        public string UserName { get; set; }
        public bool IsAdmin { get; set; }
        public UserModel User { get; set; }
    }
}